package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.Client;

public class BankReport {
    public static String reportBalance(final Bank bank) {
        StringBuilder sb = new StringBuilder("Balance report:\n");
        Client[] clients = bank.getClients();
        for (int i = 0; i < bank.getClientsCount(); i++) {
            sb.append(clients[i])
            .append("\n");
        }
        return sb.toString();
    }

    public static String printMaximumAmountToWithdraw(Bank bank) {
        StringBuilder sb = new StringBuilder("MaxAmountToWithdraw:\n");
        Client[] clients = bank.getClients();
        for (int i = 0; i < bank.getClientsCount(); i++) {
            sb.append(clients[i].getSalutation())
                .append(":\t")
                .append(clients[i].getAccount().maximumAmountToWithdraw())
                .append("\n");
        }
        return sb.toString();
    }
}
